import yaml
import os

class getYaml():

    def get_yaml(self, yamlFileName):
        curpath = os.path.dirname(os.path.dirname(__file__))
        yamlfile = os.path.join(curpath, 'testyaml/'+yamlFileName+'.yaml')
        file = open(yamlfile, 'r', encoding="utf8")
        file_data = file.read()
        file.close()
        # 指定Loader
        data = yaml.load(file_data, Loader=yaml.FullLoader)
        return data

if __name__ == '__main__':
    elements = getYaml().get_yaml(yamlFileName='login_page')
    for e in elements.values():
        print(e)